package com.ahsjdy.stcommon.enums;

import com.ahsjdy.stcommon.exception.BizException;

/**
 * @Description
 * @Author xuetao wang
 * @Date 2020/2/2
 */
public enum MerchantEnum {

    申请中(0, "申请中"),
    筹备中(1, "筹备中"),
    营业中(2, "营业中"),
    打烊(3, "打烊"),
    禁用(4, "禁用");

    private int k;
    private String v;

    private MerchantEnum(int k, String v) {
        this.k = k;
        this.v = v;
    }

    public static MerchantEnum getEnum(int k) {
        for (MerchantEnum ce : MerchantEnum.values()) {
            if (ce.getK() == k) {
                return ce;
            }
        }

        throw new BizException("非法的状态");
    }

    public int getK() {
        return k;
    }

    public String getV() {
        return v;
    }
}
